var user_id = "";
var user_list = new Array();
var field_list = new Array();
var field_mapping = {};
var smallest_year = 2005;

function InitMainPage()
{
	$.getJSON(
		"backstage_initial.php",
		{},
		function( data )
		{
			// reset data
			field_list = new Array();
			field_mapping = {};
			user_list = new Array();
			user_id = "";
	
			// get data from fserver
			if( data.status == "success" )
			{
				// setup data
				if( data.field_list != null ) field_list = data.field_list;
				if( data.user_list != null ) user_list = data.user_list;
				if( data.user_id != null ) user_id = data.user_id;
				if( data.smallest_year != null ) smallest_year = data.smallest_year;
			}
			else
			{
				alert( data.error_msg );
			}
			
			// do ui init
			InitInsertAccounting();
			InitShowAccounting();
		}
	);
}
